home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / os / sprite.X11R3 / buf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-09-03  |  1.4 KB  |  41 lines

  1. /*-
  2.  * buf.h --
  3.  *    Header for users of the buf library.
  4.  *
  5.  * Copyright (c) 1987 by the Regents of the University of California
  6.  *
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  *    "$Header: buf.h,v 1.1 88/09/02 17:52:27 ouster Exp $ SPRITE (Berkeley)"
  16.  */
  17.  
  18. #ifndef _BUF_H
  19. #define _BUF_H
  20.  
  21. #include    "sprite.h"
  22.  
  23. typedef struct Buffer *Buffer;
  24. typedef unsigned char Byte;
  25.  
  26. Buffer              Buf_Init();        /* Initialize a buffer */
  27. void              Buf_Destroy();    /* Destroy a buffer */
  28. void              Buf_AddByte();    /* Add a single byte to a buffer */
  29. void              Buf_AddBytes();   /* Add a range of bytes to a buffer */
  30. int              Buf_GetByte();    /* Get a byte from a buffer */
  31. int              Buf_GetBytes();   /* Get multiple bytes */
  32. void          Buf_UngetByte();  /* Push a byte back into the buffer */
  33. void          Buf_UngetBytes(); /* Push many bytes back into the buf */
  34. Byte              *Buf_GetAll();    /* Get them all */
  35. void              Buf_Discard();    /* Throw away some of the bytes */
  36. int              Buf_Size();        /* See how many are there */
  37.  
  38. #define BUF_ERROR 256
  39.  
  40. #endif _BUF_H
  41.